package service.user;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.common.BaseMapper;
import com.common.BaseService;

import mapper.user.suberrorMapper;
import mapper.user.subresultMapper;
import mapper.user.wxuserMapper;

@Service
@Transactional
public class SubErrorServiceImpl<T> extends BaseService<T>{

	@Autowired
	private suberrorMapper<T> _suberrorMapper;

	@Override
	public BaseMapper<T> getMapper() {
		return _suberrorMapper;
	}
	
	public void Adds(List<T> list) {
		_suberrorMapper.adds(list);
	}

	/**
	 * 根据会员id获取错误题目数量
	 * @param id
	 * @return
	 */
	public List<Map> getByUser(String uid) {
		return _suberrorMapper.getListByUser(uid);
	}

	/**
	 * 根据用户id和题目id删除错误题目
	 * @param errlist
	 * @param id
	 */
	public void deletebyid(String[] errlist, String uid) {
		_suberrorMapper.deletebyid(errlist,uid);
	}
}